import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data: data
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

export function getInfo(token) {
  return request({
    url: '/system/user/info',
    method: 'get',
    params: { token }
  })
}


export function getUsers(params) {
  return request({
    url: '/web/business/tbUserAuth/page',
    method: 'get',
    params: params
  })
}

export function getUserById(id) {
  return request({
    url: '/web/business/tbUserAuth/'+id,
    method: 'get'
  })
}

export function addUser(param) {
  return request({
    url: '/web/business/tbUserAuth',
    method: 'post',
    data: param
  })
}

export function updateUser(param) {
  return request({
    url: '/web/business/tbUserAuth',
    method: 'put',
    data: param
  })
}


export function deleteUser(id) {
  return request({
    url: '/web/business/tbUserAuth/'+id,
    method: 'delete',
    params: {}
  })
}

